<!DOCTYPE html>
<html>
    <head>
        <!-- 当前文档的字符集编码为utf-8 -->
        <meta charset="utf-8">
        <meta name = "author" content="wyrQF">
        <meta name="keywords" content="CGI开发 H5模版 千锋教育 西安物联网">
        <title>测试姓名得分</title>
        <link rel="stylesheet" href="/css/my.css">
        <style>
            img{
                width: 100%;
                width: 100%;
                z-index: -1;
                /* position: absolute; 脱离文档流 结合left top right bottom确定*/
                position: absolute;
                left: 0;
                top: 0;
            }
        </style>
    </head>
    <body>
        <img id="preImg" src="/img/GULULU-彩虹宝宝.png" >
        <script>
            let imgs = ["/img/GULULU-冰奶昔.png","/img/GULULU-彩球罐.png","/img/GULULU-彩虹宝宝.png"];
            let img_idx = 0;
            let id_ = setInterval(function(){
                img_idx++;
                if(img_idx >= imgs.length) img_idx = 0;

                // 设置标签属性
                preImg.setAttribute("src",imgs[img_idx]);
            },3000);
        </script>
    </body>
</html>
